<?php
/**
 * Created by PhpStorm.
 * User: pc
 * Date: 2019-4-11
 * Time: 18:51
 */
namespace app\blogadmin\validate;

use think\Validate;

class Article extends Validate{
    //验证规则
    protected $rule=[
        'upload' => [ 'image' => '225,225', 'fileExt' => 'png,jpg', 'fileSize' => 120400],
    ];

    //验证的提示信息
    protected $message = [
        'upload.fileExt' => '文件格式不正确，仅支持.png/.jpg',
        'upload.fileSize' => '文件大小不合法，请重新上传',

    ];

    //验证的场景（在什么时候用这个验证）
    protected $scene = [
        'add' => ['upload'],

    ];

}